package com.download.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.download.web.entity.BusArticleDownload;
import com.download.web.entity.model.CommentModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @description:
 * @author: cmy
 * @create: 2019-02-21 17:05
 **/
public interface BusArticleDownloadMapper  extends BaseMapper<BusArticleDownload> {

    //查找文章一级评论
    @Select(" SELECT d.* from bus_article_download d  " +
            " where d.article_id=${artId} " +
            " limit ${pageIndex},${pageSize} ")
    List<BusArticleDownload> downloadListByArticle(@Param("artId")Integer artId, @Param("pageIndex")Integer pageIndex, @Param("pageSize")Integer pageSize);
    //查找文章一级评论数量
    @Select(" SELECT count(1) from bus_article_download d  " +
            " where d.article_id=${artId} " )
    Integer downloadCountByArticle(@Param("artId")Integer artId);

}
